<?
include('seguridad.php');
include('bd.php');
Conectar();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> BideYoday </TITLE>
  <META NAME="Generator" CONTENT="DILAPER">
  <META NAME="Author" CONTENT="Power by Sebastian Costa - Design: Nadia De Cinti">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <link href="../style.css" rel="stylesheet" type="text/css">
  <script src="../js/botonera.js" type="text/javascript"></script>
  <script language="JavaScript" type="text/JavaScript">
function validar_coment(form)
{
	if(form.shape.value == '') {
		alert("Please, completes the field");
		form.shape.focus();
		return false;
	}
		
	document.getElementById('form_shape').submit();
}
</script>
 </HEAD>

 <BODY topmargin="0">
<center>
<table width="990" height="100%" cellspacing="0" cellpadding="0" class="fondo" border="0">
	<tr>
		<td width="100%" height="100%" align="center" valign="top">
			<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
				<tr>
					<td align="center" valign="top">
<div style="height: 135px"></div>
<!-- contenido -->
<table width="800"  border="0" class="admin_area" cellspacing="0" cellpadding="0">
	<tr bgcolor="#ffffff">
		<td align="right" height="30">
Welcome <?echo $_SESSION['usuario'];?>&nbsp;|&nbsp;<a href="salir.php"><font color="red">Log Out</font></a>&nbsp;&nbsp;
		</td>
	</tr>	
	<tr><td height="3"></td></tr>
	<tr bgcolor="#ffffff">
		<td align="right" height="50">
<?include('menu.php');?>
		</td>
	</tr>	
	<tr><td height="3"></td></tr>
	<tr bgcolor="#ffffff">
		<td align="left" valign="top" height="300"  class="tabla_central">
<div style="margin: 10px">
<b><span class="titulo_admin">Products&nbsp;/&nbsp;Shape</span></b><br>
<a href="products_color.php" class="admin_link">To define color</a>
	<table width="100%" border="0" class="tabla_admin">
		<tr>
			<td width="40%" valign="top">
<br>
List of Shape<br>
<br>
<table width="100%" border="0" class="tabla_admin">
	<tr>
		<td align="center" bgcolor="#ffffff">
<b>Shape</b>
		</td>
		<td align="center" bgcolor="#ffffff">
<b>Actions</b>
		</td>
	</tr>
<?
$result=mysql_query("SELECT * FROM shape ORDER BY shape");
$w=1;
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
	if($bg_num%2==0){
$bg='bgcolor="#B4B4B4"';
}else{
$bg='bgcolor="#DDDDDD"';
}
?>
	<tr id="d_<?echo$w;?>">
		<td align="center" <?echo$bg;?>>
<?echo$row[shape];?>
		</td>
		<td align="center" <?echo$bg;?> onclick="document.getElementById('m_<?echo$w;?>').style.display = 'table-row'; document.getElementById('d_<?echo$w;?>').style.display = 'none'" style="cursor: pointer">
<span>Edit</span>
		</td>
	</tr>

<form name="m_f_<?echo$w;?>" method="POST" action="acciones/products_shape_edit.php">
<tr id="m_<?echo$w;?>" style="display: none">
		<td align="center" <?echo$bg;?>>
<input type="hidden" name="id" value="<?echo$row[id];?>">
<input type="text" name="shape" value="<?echo$row[shape];?>"><br>
Delete&nbsp;<input type="checkbox" name="borrar" value="yes">
		</td>
		<td align="center" <?echo$bg;?> onclick="document.getElementById('m_<?echo$w;?>').style.display = 'table-row'; document.getElementById('d_<?echo$w;?>').style.display = 'none'" style="cursor: pointer">
<input type="submit" value="Edit Shape" >
		</td>
	</tr>
</form>
<?$bg_num++;
$w++;}?>
</table>
			</td>
			<td width="20%"></td>
			<td width="40%" valign="top">
<br>
To define New Shape<br>
<br>
<form name="form_shape" id="form_shape" method="POST" action="acciones/products_shape_save.php" enctype="multipart/form-data">
<table width="100%" border="0" class="tabla_admin">
	<tr>
		<td align="right" bgcolor="#ffffff">
<b>Name&nbsp;&nbsp;</b>
		</td>
		<td>
<input type="shape" name="shape">
		</td>
	</tr>
	<tr>
		<td colspan="2" bgcolor="#ffffff" align="center">
<input type="button" value="New Shape" onClick="javascript:validar_coment(document.getElementById('form_shape'));">
		</td>
	</tr>
</table>
</form>
			</td>
		</tr>
	</table>
</div>
<br>
		</td>
	</tr>
</table>
<table width="800" border="0" class="admin_area" cellspacing="0" cellpadding="0">
	<tr>
		<td height="3">

		</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td align="right">
<?include('inc/foot.php');?>
		</td>
	</tr>
</table>
<!-- fin contenido -->
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</center>
 </BODY>
</HTML>
<?Desconectar();?>